package main

import "fmt"

func TypeJudge(items ...interface{}) {
	for i, x := range items {

		switch x.(type) {
		case bool:
			fmt.Printf("param #%d is a bool 值是 %v\n", i, x)
		case float64:
			fmt.Printf("param #%d is a float64 值是 %v\n", i, x)
		case int, int64:
			fmt.Printf("param #%d is a int 值是 %v\n", i, x)
		case nil:
			fmt.Printf("param #%d is a nil 值是 %v\n", i, x)
		case string:
			fmt.Printf("param #%d is a string 值是 %v\n", i, x)
		case Student:
			fmt.Printf("param #%d is a Student 值是 %v\n", i, x)
		case *Student:
			fmt.Printf("param #%d is a *Student 值是 %v\n", i, x)
		default:
			fmt.Printf("param #%d is unknown 值是 %v\n", i, x)

		}
	}
}

type Student struct {
}

func main() {
	var v1 float32 = 1.1 + 3
	var v2 float64 = 2.27
	var v3 int32 = 33
	var name string = "北京"
	n4 := 44

	stu1 := Student{}
	stu2 := &stu1

	TypeJudge(v1, v2, v3, name, n4, stu1, stu2)
}
